<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="//cdn.66173.cn/www/js/jquery-1.8.3.min.js"></script>
</head>
<body>
<p class="p2" style="font-size: 30px"></p>
</body>
<script>
    $(document).ready(function () {
        var person = new Object();
        person.name = "Nicholas";
        person.age = 29;
        person.job = "Software Engineer";
        person.sayName = function(){
            // alert(this.name);
         };
        person.sayName();
        add()
        traverse()
    })
</script>
<script>
    var data= {
        a: { one: 1, two: 2, three: {four:'2',five:'4'} },
        b: { six: 4, seven: 5, eight: 6 },
        c: { nine: 7, ten: 8}
    }
    function traverse(obj) {
        for (var a in obj) {
            if (typeof(obj[a]) == "object") {
                traverse(obj[a]); //递归遍历
            } else {
                console.log(a + "=" + obj[a]); //如果是值就显示
            }
        }
    }
    traverse(data)
</script>
<script>
    // $(document).ready(function () {
    //     for (var n=1;n<=9;n++) {
    //         for (var m=1;m<n+1;m++) {
    //             var b=m*n;
    //             if(n%2==0){
    //                 document.write("<span style='border: 1px solid red;margin: 10px 10px'>"+m+"×"+n+"="+b+" "+" " + "</span>");
    //             }else{
    //                 document.write("<span style='border: 1px solid #3860ff;margin: 10px 10px'>"+m+"×"+n+"="+b+" "+" " + "</span>");
    //             }
    //             // document.write("<span style='border: 1px solid red;margin: 10px 10px'>"+m+"×"+n+"="+b+" "+" " + "</span>");
    //         }
    //         document.write("<br/>");
    //         document.write("<br/>")
    //     }
    // })
</script>
<script>
    function add() {
        var arr=[];
        var sum = 0;
        for(var i = 1; i <= 30;i++){
            arr.push(i);

            for(var j = 0,len = arr.length; j < len; j++){
                if(j==len-1){
                    // console.log(arr[j]);
                }
                $('.p2').html(arr[j])
            }
        }
    }
</script>
</html>